package game 
{
	import flash.display.MovieClip;
	import flash.display.Sprite;
	/**
	 * ...
	 * @author Nevena
	 */
	public class PlayerController extends Sprite
	{
		private var player:MovieClip;
		private var playerNormal:int;
		
		[Embed(source="../../assets/players.swf", symbol="GreyPlayer")]
		private var greyPlayer:Class;
		[Embed(source="../../assets/players.swf", symbol="RedPlayer")]
		private var redPlayer:Class;
		
		public function PlayerController(type:int) 
		{
			if (type)
			{
				player = new redPlayer();
				//player = new RedPlayer();
			}
			else
			{
				player = new greyPlayer();
			}
						
			this.addChild(player);
			playerNormal = player.head.y; //initial normal position
		}
		
		public function setPoints(value:int):void
		{
			player.points.text = String(value);
		}
		
		public function onMove():void
		{
			player.head.y -= 15;
		}
		
		public function normal():void
		{
			player.head.y  = playerNormal;
		}
				
	}

}